<?php
/**
 *  
 * @package Nokia Places Plugin
 * @title Default template iframe core
 * @author Nikolai Tihhomirov
 *
 */
 //include wp-load.php
require_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/placesapi_config.php');
//check rights
if ( !current_user_can( 'edit_pages' ) && !current_user_can( 'edit_posts' ) ) 
	wp_die( __( "You are not allowed to be here" ) );
global $wpdb;
//Get GET variables
if( isset( $_GET['placeid'] ) && isset( $_GET['iframeid'] ) ){
$placeid = $_GET['placeid'];
$iframe_id = $_GET['iframeid'];
unset( $_GET['placeid'] );
unset( $_GET['iframeid'] );
}else{ wp_die( __( "No place Id" ) );}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
	<!--Insert unique frameid for resize function -->
    <meta id="iframeid" content="<?php echo $iframe_id?>"/>
	<!--Insert core js -->
    <script type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-content/plugins/nokia-places-plugin/placesapi/jsPlacesAPI-en_GB.js"></script>
	<script type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-content/plugins/nokia-places-plugin/placesapi/configuration.js"></script>
	<script type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-content/plugins/nokia-places-plugin/tinymce/page/js/resize.js"></script>
    </head>
    <body onload="reSize()">
       <div id="content"><div id="basic"></div></div>
       <script type="text/javascript">
	
            var basicPlace = new nokia.places.Place({
                placeId: "<?php echo $placeid?>",
                targetNode: 'basic'
            }); 
        </script>
    </body>
</html>
